package rtmpExample
{
	import flash.display.Stage;
	
	import org.osmf.containers.MediaContainer;
	import org.osmf.elements.VideoElement;
	import org.osmf.media.MediaPlayer;
	import org.osmf.media.URLResource;

	public class RtmpExample
	{
		private var _root:Stage;
		public function RtmpExample(root:Stage)
		{
			_root = root;
			
			//此种写法是指向 application/vod/media中的sample.flv文件，
			//rtmpe://localhost/vod/sample = rtmpe://localhost/vod/sample.flv
			var videoPath:String = "rtmpe://localhost/vod/sample";
			
			//此种写法是指向 application/vod/media中的sample1_1500kbps.f4v文件，f4v文件是flv+mp4，高清的H.264
			var videoPath_mp4:String = "rtmpe://localhost/vod/mp4:sample1_1500kbps.f4v";
			
			//正规MP4格式 Vultures.mp4
			var videoPath_real_mp4:String = "rtmpe://localhost/BabyVultures/mp4:Waterfall.f4v";
			
			var videoPath_f4m:String = "rtmp://localhost/vod/rtmp_sample1_manifest.f4m";

			var resource:URLResource = new URLResource( videoPath );
			var element:VideoElement = new VideoElement( resource );
			var mediaPlayer:MediaPlayer= new MediaPlayer( element );
			var mediaContainer:MediaContainer = new MediaContainer();
			
			mediaContainer.addMediaElement( element );
			
			_root.addChild( mediaContainer );
		}
	}
}